package com.rzcode.coinex.kernel.dao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * ActivityOrder 表示活动订单的信息。
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "activity_order")
public class ActivityOrder implements Serializable {

    /**
     * 主键自增ID
     */
    @ApiModelProperty(value = "主键ID", required = true, example = "1")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 活动ID
     */
    @ApiModelProperty(value = "活动ID", required = true, example = "1001")
    private Long activityId;

    /**
     * 活动名称
     */
    @ApiModelProperty(value = "活动名称", example = "春节特惠活动")
    private String activityName;

    /**
     * 成员ID
     */
    @ApiModelProperty(value = "成员ID", required = true, example = "2001")
    private Long memberId;

    /**
     * 状态：0：临时  1：未成交  2：已成交  3：撤销
     */
    @ApiModelProperty(value = "状态：0-临时, 1-未成交, 2-已成交, 3-撤销", example = "1")
    private int state = 1;

    /**
     * 活动类型(0:未知，1：首发抢购，2：首发分摊，3：持仓瓜分，4：自由认购）
     */
    @ApiModelProperty(value = "活动类型：0-未知, 1-首发抢购, 2-首发分摊, 3-持仓瓜分, 4-自由认购", example = "1")
    private int type = 0;

    /**
     * 当type=3时有效，代表冻结资产数量
     */
    @ApiModelProperty(value = "冻结资产数量（仅当type=3时有效）", example = "100.00")
    private BigDecimal freezeAmount = BigDecimal.ZERO;

    /**
     * 获得币种数量
     */
    @ApiModelProperty(value = "获得币种数量", example = "50.00")
    private BigDecimal amount = BigDecimal.ZERO;

    /**
     * 获得币种价格（type=3时该字段无效）
     */
    @ApiModelProperty(value = "获得币种价格（type=3时无效）", example = "2.50")
    private BigDecimal price = BigDecimal.ZERO;

    /**
     * 成交额，type=3时无效
     */
    @ApiModelProperty(value = "成交额（type=3时无效）", example = "125.00")
    private BigDecimal turnover = BigDecimal.ZERO;

    /**
     * 币单位
     */
    @ApiModelProperty(value = "币单位", example = "BTC")
    private String coinSymbol;

    /**
     * 结算单位(type=3时，此为冻结资产符号）
     */
    @ApiModelProperty(value = "结算单位（type=3时为冻结资产符号）", example = "USDT")
    private String baseSymbol;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间", example = "2023-01-01 12:00:00")
    private LocalDateTime createTime;
}
